package util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringUtil {
     private static ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");//获得applicationContext.xml
   
     public static Object getBean(String beanName){
    	 Object ret=null;
    	 try {
			ret=context.getBean(beanName);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ret;
     }
}
